<?php


/**
 * This class defines the structure of the 'team' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    orm.map
 */
class TeamTableMap extends TableMap {

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'orm.map.TeamTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
	  // attributes
		$this->setName('team');
		$this->setPhpName('Team');
		$this->setClassname('Team');
		$this->setPackage('orm');
		$this->setUseIdGenerator(true);
		// columns
		$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, 11, null);
		$this->addColumn('NAME', 'Name', 'VARCHAR', false, 30, null);
		$this->addColumn('CODE', 'Code', 'VARCHAR', false, 4, null);
		$this->addColumn('IS_ACTIVE', 'IsActive', 'CHAR', false, 1, 'Y');
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
    $this->addRelation('PlayerToTeam', 'PlayerToTeam', RelationMap::ONE_TO_MANY, array('id' => 'team_id', ), null, null);
    $this->addRelation('TournamentToTeam', 'TournamentToTeam', RelationMap::ONE_TO_MANY, array('id' => 'team_id', ), null, null);
    $this->addRelation('MatchScheduleRelatedByFirstTeam', 'MatchSchedule', RelationMap::ONE_TO_MANY, array('id' => 'first_team', ), null, null);
    $this->addRelation('MatchScheduleRelatedBySecondTeam', 'MatchSchedule', RelationMap::ONE_TO_MANY, array('id' => 'second_team', ), null, null);
    $this->addRelation('LeagueTeam', 'LeagueTeam', RelationMap::ONE_TO_MANY, array('id' => 'team_id', ), null, null);
	} // buildRelations()

} // TeamTableMap
